#include <iostream>
#include <cstring>
using namespace std;

typedef long long ll;
int t, n, vis[15];
struct plane
{
	int t;
	int d;
	int l;	
}p[15];


bool dfs(int dep, int tim)
{
	if(dep > n) return true;
	for(int i = 1; i <= n; i++)
	{
		if(vis[i] || (p[i].t + p[i].d < tim)) continue;
		vis[i] = true;
		if(dfs(dep + 1, max(tim, p[i].t) + p[i].l)) {
			vis[i] = true;
			return true;
		}
		vis[i] = false;
	}
	return false;
}
int main()
{
	cin >> t;
	while(t--)
	{
		cin >> n;
		for(int i = 1; i <= n; i++)
		{
			cin >> p[i].t >> p[i].d >> p[i].l;
		}
		memset(vis, 0, sizeof vis);
		if(dfs(1, 0)) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}
